; ModuleID = 'sample.c'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

  @.str = private unnamed_addr constant [14 x i8] c"1+...+100=%d\0A\00", align 1

define i32 @main() nounwind uwtable {
  %1   =   alloca      i32		, align 4
  %sum =   alloca      i32		, align 4
  %i   =   alloca      i32		, align 4
     	   store       i32    0	   	, i32* %1
  	   store       i32    1    	, i32* %i	, align 4
  	   br 	       label %2

  %3   =   load        i32*  %i		, align 4
  %4   =   icmp slt    i32   %3		, 100
     	   br          i1    %4		, label %5	, label %12

  %6   =   load        i32*  %i		, align 4
  %7   =   load        i32*  %sum	, align 4
  %8   =   add nsw     i32   %7		, %6
     	   store       i32   %8		, i32* %sum	, align 4
  	   br 	       label %9

  %10  =   load        i32*  %i		, align 4
  %11  =   add nsw     i32   %10	, 1
      	   store       i32   %11	, i32* %i	, align 4
  	   br 	       label %2

  %13  =   load        i32* %sum	, align 4
  %14  =   call        i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0), i32 %13)
      	   ret 	       i32 0
}

	   declare i32 @printf(i8*, ...)
